﻿
<script>
    var model = avalon.define({
        $id: "KHGLADD",
        ColumnData: [],
        modelData: { "KHLeiBie": "", "KHXinBie": "先生", "KHName": "", "KHZhiWu": "", "KHPhone": "", "KHFXRS": ComFunJS.getnowuser(), "KHDW": "", "KHAdress": "", "Files": "", "Remark": "" }
    });
    function getdata() {
        model.modelData.$model.Remark = UM.getEditor('conNR').getContent();
        var modelValue = JSON.stringify(model.modelData.$model);
        return { Action: "ADDKHGL", P1: modelValue };
    }

    var strId = ComFunJS.getQueryString("ID");
    avalon.ready(function () {
        $.getJSON('/API/FTAPI.ashx?Action=GETCOLUMNLIST', { P1: 8 }, function (resultData) {
            if (resultData.ErrorMsg == "") {
                model.ColumnData = resultData.Result;
                model.modelData.KHLeiBie = resultData.Result[0].TypeNO;
            }
        })
        if (strId != null) {
            $.getJSON('/API/FTAPI.ashx?Action=GETKHGLMODEL', { P1: strId }, function (resultData) {
                if (resultData.ErrorMsg == "") {
                    model.modelData = resultData.Result;
                }
            })
        }
    })
</script>
<div class="form-horizontal" ms-controller="KHGLADD">
    <div class="form-group">
        <label class="col-xs-2 control-label"> <span class="Required">*</span>客户种类 </label>
        <div class="col-xs-3">
            <select ms-duplex="modelData.KHLeiBie" class="form-control">
                <option ms-attr-val="item.TypeNO" ms-repeat-item="ColumnData">{{item.TypeNO}}</option>
            </select>
        </div>
        <label class="col-xs-2 control-label">客户性别</label>
        <div class="col-xs-3">
            <select ms-duplex="modelData.KHXinBie" class="form-control">
                <option value="先生">先生</option>
                <option value="女士">女士</option>
            </select>
        </div>
    </div>
    <div class="form-group">
        <label class="col-xs-2 control-label"><span class="Required">*</span>客户名称</label>
        <div class="col-xs-3">
            <input type="text" value="" ms-duplex="modelData.KHName" class="form-control szhl_require" />
        </div>
        <label class="col-xs-2 control-label">职务</label>
        <div class="col-xs-3">
            <input type="text" value="" ms-duplex="modelData.KHZhiWu" class="form-control " />
        </div>
    </div>
    <div class="form-group">
        <label class="col-xs-2 control-label"><span class="Required">*</span>手机号</label>
        <div class="col-xs-3">
            <input type="text" value="" ms-duplex="modelData.KHPhone" class="form-control " />
        </div>

    </div>
    <div class="form-group">
        <label class="col-xs-2 control-label"><span class="Required">*</span>所属单位</label>
        <div class="col-xs-8">
            <input type="text" value="" ms-duplex="modelData.KHDW" class="form-control " />
        </div>
    </div>
    <div class="form-group">
        <label class="col-xs-2 control-label"><span class="Required">*</span>联系地址</label>
        <div class="col-xs-8">
            <input type="text" value="" ms-duplex="modelData.KHAdress" class="form-control " />
        </div>
    </div>
    <div class="form-group">
        <label class="col-xs-2 control-label">客户负责人员</label>
        <div class="col-xs-8">
            <input type="text" value="" ms-duplex="modelData.KHFXRS" class="form-control szhl_getPeoples" />
        </div>
    </div>

    <div class="form-group">
        <label class="col-xs-2 control-label">备注</label>
        <div class="col-xs-8">
            <textarea id="conNR" ms-duplex="modelData.Remark" class="szhl_UEEDIT form-control "></textarea>
        </div>
    </div>
    <div class="form-group">
        <label class="col-xs-2 control-label">附件</label>
        <div class="col-xs-9">
            <input type="text" value="" class="span2  szhl_Upload form-control" ms-duplex="modelData.Files" />
        </div>
    </div>
</div>
